Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix unary operator ceil/floor/trunc when data type is integer #14251

Merged
merged 3 commits into from
Sep 7, 2019

Conversation

apeforest
Copy link
Contributor

@apeforest apeforest commented Feb 25, 2019

Description

Many operators implicitly cast data to float and return inaccurate results. This PR fixes #13220.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • [] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

Comments

@anirudhacharya
Copy link
Member

@mxnet-label-bot add [pr-work-in-progress]

@marcoabreu marcoabreu added the pr-work-in-progress PR is still work in progress label Feb 27, 2019
Copy link
Member

@szha szha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. It would be great to test for it.

@pinaraws
Copy link

@apeforest Could you please add a test as suggested by @szha ?

@piyushghai
Copy link
Contributor

@apeforest Gentle ping...

@karan6181
Copy link
Contributor

@apeforest Thanks for your contribution! Did you get a chance to add a test ?

@apeforest apeforest closed this Aug 23, 2019
@apeforest apeforest deleted the bugfix/issue13220 branch August 23, 2019 17:09
@apeforest apeforest restored the bugfix/issue13220 branch September 5, 2019 18:35
@apeforest apeforest reopened this Sep 5, 2019
@apeforest apeforest changed the title [WIP] Fix unary operator ceil/floor/trunc when data type is integer Fix unary operator ceil/floor/trunc when data type is integer Sep 5, 2019
@apeforest apeforest added pr-awaiting-review PR is waiting for code review and removed pr-work-in-progress PR is still work in progress labels Sep 5, 2019
Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eric-haibin-lin eric-haibin-lin merged commit 4f8bc3a into apache:master Sep 7, 2019
@eric-haibin-lin
Copy link
Member

thx for the fix

gyshi pushed a commit to gyshi/incubator-mxnet that referenced this pull request Sep 7, 2019
…#14251)

* fix integer precision loss due to casting to float

* add test

* update comment
gyshi pushed a commit to gyshi/incubator-mxnet that referenced this pull request Sep 7, 2019
…#14251)

* fix integer precision loss due to casting to float

* add test

* update comment
larroy pushed a commit to larroy/mxnet that referenced this pull request Sep 28, 2019
…#14251)

* fix integer precision loss due to casting to float

* add test

* update comment
@apeforest apeforest deleted the bugfix/issue13220 branch January 7, 2020 22:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Many operators don't work for integer type
10 participants